/***************************************************
> Copyright (C) 2024 ==KINGYI== All rights reserved.
> File Name: 7.29作业2.c
> Author:
> Mail: 
> Created Time: Sun 28 Jul 2024 08:45:56 PM PDT
***************************************************/

#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
#include <stdlib.h>
int main(int argc,const char* argv[])
{
	int fd=0,fu=0;
	int ret=0;
	char dest[1024]={0};
	fd=open("电影.txt",O_RDONLY);
    fu=open("test.txt",O_RDWR|O_CREAT|O_APPEND,0640);
	if(fd==-1)
	{
		perror("open");
		exit(-1);
	}
	while(ret=read(fd,dest,sizeof(dest)))
	{
		write(fu,dest,ret);
	}

	close(fd);
	close(fu);
	return 0;
}
